package com.itheima.api.dateformat.demo01;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateFormatDemo01 {

    public static void main(String[] args) {

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat();

        String format = simpleDateFormat.format(new Date());
        System.out.println(format);

        String pattern = simpleDateFormat.toPattern();
        System.out.println(pattern);

        System.out.println("---------------------------------------------------");

        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String format1 = dateFormat.format(new Date());
        System.out.println(format1);

    }

}
